package com.clps.algorithm.chapter01.前n个数字二进制中1的个数;

public class demo03 {

    public static void main(String[] args) {

    }

    public int[] countBits(int num){
        int[] result = new int[num + 1];
        for (int i = 0; i <=num ; i++) {
            result[i] = result[i>>1]+(i & 1);
        }
        return  result;
    }
}
